package com.blog.service;

import com.blog.mapper.ProductCategoryMapper;
import com.blog.seckill.goods.ProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ProductCategoryBaseService
 * @Destription ProductCategory基础：增删改查
 * @Author 天堂小野花
 * @Date 2025/8/19  18:23
 * @Version 1.0
 */
@Service
public class ProductCategoryBaseService {
    @Autowired
    ProductCategoryMapper productCategoryMapper;

    //表 ProductCategory
    public ProductCategory selectProductCategoryById(Integer categoryId){
        return productCategoryMapper.selectByPrimaryKey(categoryId);
    }
    public int insertProductCategory(ProductCategory productCategory){
        return productCategoryMapper.insert(productCategory);
    }
    public int updateProductCategory(ProductCategory productCategory){
        return productCategoryMapper.updateByPrimaryKeySelective(productCategory);
    }
    public int deleteProductCategoryById(Integer categoryId){
        return productCategoryMapper.deleteByPrimaryKey(categoryId);
    }

    public List<ProductCategory> selectAllProductCategory() {
        return productCategoryMapper.selectAllProductCategory();
    }
}
